home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Business & Presentations
/
Business and Presentations - Volume 1 (1995)(Sideface)(NL).iso
/
drivers
/
hpps76
/
hpps.asm
next >
Wrap
Assembly Source File
|
1989-06-20
|
14KB
|
628 lines
page 78,122
title HPPS -- HP LaserJet+/SeriesII PrtSc Driver 7.6
;Revision history:
;06/02/89 Modified to read from all planes in EGA mode : 7.6
;05/14/89 Modified Text Screen printing for BBS's status lines : 7.5
;01/30/89 Translation table purged if /2 option (SeriesII) used : 7.4
;01/11/89 Added Margin Reset and released source code : 7.3
;01/04/89 Added Printer Reset to init strings : 7.2
;----------------------------------------------------------------------------
data segment at 40h
org 84h
rows db ?
data ends
;----------------------------------------------------------------------------
EGA_seg segment at 0a000h
EGA_seg ends
;----------------------------------------------------------------------------
MON_seg segment at 0b000h
MON_seg ends
;----------------------------------------------------------------------------
CGA_seg segment at 0b800h
CGA_seg ends
;----------------------------------------------------------------------------
code segment para 'code'
assume cs:code,ds:code,es:code
cseg_start equ $
org 100h
start: jmp PrtSc
;---------------------------------------
hp_EGAinit db 27,'E',27,'9',27,'&l0O',27,'&a1000h720V',27,'*t75R',27,'*r1A',0
hp_EGAline db 27,'*b44W',0
hp_EGAlineE db 27,'*b50W',0
hp_CGAinit db 27,'E',27,'9',27,'&l0O',27,'&a600h600V',27,'*t100R',27,'*r1A',0
hp_CGAline db 27,'*b80W',0
hp_Text db 27,'E',27,'9',27,'(8U',27,'(s0p10H',0
hp_Text2 db 27,'E',27,'9',27,'(10U',27,'(s0p10H',0
hp_CGAtext40 db 27,'&a0C',27,'&p40X',0
hp_CGAtext80 db 27,'&a0C',27,'&p80X',0
hp_end db 27,'*rB',27,'&a0C',12,0
hp_crlf db 13,10,0
hp_ff db 12,0
busy db 0
reverse db 0
seriesII db 0
mode db ?
width_ db ?
vpage db ?
vid_seg dw ?
delta dw ?
line_buffer db 352 dup (0)
;---------------------------------------
; Screen snapshot routine
snapshot: cmp cs:[busy],0 ;Continue if not busy
jz go_ahead ;
iret ;
go_ahead: inc cs:[busy] ;Set busy
sti ;let the dogs back in
push ax ;save state
push bx
push cx
push dx
push bp
push si
push di
push ds
push es
mov ax,cs ;setup ds,es
mov ds,ax ;
mov es,ax ;
cld ;set direction flag
mov ah,15 ;Get video mode
int 10H ;
mov [mode],al ;
mov [width_],ah ;
mov [vpage],bh ;
cmp al,4 ;See if 0-3
jb CGA_Text ;Text modes use same routine
cmp al,7 ;see if mode 4-6
je CGA_Text ;mod 7 is text
ja try_EGAmD ;
jmp CGA_G6 ;
try_EGAmD: cmp al,0dH ;CGA/EGA 320x200
jne try_EGAmE
jmp EGA_modeDE
try_EGAmE: cmp al,0eh ;CGA/EGA 640x200
jne try_MONmF ;
jmp EGA_modeDE ;
try_MONmF: cmp al,0fh ;MON 640x350
jne try_EGAm10 ;
jmp MON_modeF ;
try_EGAm10: cmp al,10H ;EGA Hi-res modes
jne cant_do
jmp EGA_mode10
cant_do: call beep ;beep now and again
jmp exit ;none of the above
;---------------------------------------
CGA_Text: mov ah,3 ;get cursor position
int 10h ;
push dx ;save it for later restore
mov bx,offset hp_Text ;Init Printer
cmp [seriesII],0 ;for LaserJet+
je init_text ;
mov bx,offset hp_Text2 ;for SeriesII
init_text: call print_msg ;
xor dx,dx ;set to start at top of screen
mov ax,1200h ;see if EGA here
mov bx,0ff10h ;set bh to illegal value
int 10h ;
mov cl,[width_]
mov ch,25 ;25 lines default for CGA adapter
cmp bh,0ffh ;see if bh changed
je T1 ;no -- don't update ch
assume ds:data
push ds ;save ds
mov ax,data ;set for BIOS data area
mov ds,ax ;
mov ch,[rows] ;
inc ch ;
pop ds ;
assume ds:code
T1: mov bx,offset hp_CGAtext40
cmp cl,40
je T2
mov bx,offset hp_CGAtext80
T2: push bx
push dx
call print_msg
pop dx
T3: push dx ;save cursor position
mov bh,[vpage] ;set new cursor position
mov ah,2 ;
int 10h ;
mov ah,8 ;read char at cursor position
int 10h ;
cmp [seriesII],0 ;see if seriesII
jnz series2 ;yes - skip xlate
mov bx,offset xlat_
xlat ;translate char
series2: xor dx,dx ;set for lpt1:
xor ah,ah ;ah=0 print char
int 17h ;print it
pop dx ;restore cursor position
inc dl ;bump column counter
cmp dl,cl ;EOL ?
jnz T3 ;no -- same line, do next char
xor dl,dl ;reset column counter
push dx
mov bx,offset hp_crlf ;print crlf
call print_msg ;
pop dx
pop bx
inc dh ;bump row counter
cmp dh,ch ;end of screen ?
jnz T2 ;no -- do next line
pop dx ;restore cursor position
mov ah,2 ;
mov bh,[vpage] ;
int 10h ;
mov bx,offset hp_ff ;eject page
call print_msg
jmp exit ;bye
;---------------------------------------
CGA_G6: mov ax,CGA_Seg
mov ds,ax
mov bx,offset hp_CGAinit
call print_msg
mov si,0H
mov cx,100
CGA_G6loop1: push cx
push si
mov cx,2 ;print two lines per iteration
CGA_G6loop1a: push cx
push si
mov cx,2 ;print each line twice for aspect ratio
CGA_G6loop2: push cx
push si ;save SI for second time printing
mov bx,offset hp_CGAline
call print_msg
mov cx,80
CGA_G6loop3: lodsb
xor al,cs:[reverse]
xor ah,ah
int 17H
loop CGA_g6loop3
pop si
pop cx
loop CGA_G6loop2
pop si
add si,8*1024 ;odd scan lines are 8K further in buffer
pop cx
loop CGA_G6loop1a
pop si
add si,80 ;next even line is 80 bytes in buffer
pop cx
loop CGA_G6loop1
mov bx,offset hp_end
call print_msg
jmp exit
;---------------------------------------
EGA_modeDE: mov bx,40
mov cx,8192/16
cmp al,0dh ;320x200 ?
je no_shift ;yes dont adjust
shl bx,1 ;bx=80
shl cx,1 ;cx=16384/16
no_shift: mov al,[vpage] ;index into correct page
xor ah,ah ;
mul cx ;
add ax,EGA_seg ;
mov [vid_seg],ax ;
mov cx,bx ;
mov [delta],bx ;
mov bx,offset hp_EGAinit
call print_msg
EGAmEloop1: push cx ;
mov si,cx
dec si
mov ax,[vid_seg] ;EGA RAM Buffer
push ds
mov ds,ax
mov di,offset line_buffer ;
mov cx,200 ;read in one column for 200 rows
EGAmEloop2: call get_byteEGA ;(DS:SI) --> (ES:DI)
inc di
add si,es:[delta] ; move pointers
loop EGAmEloop2
pop ds
mov cx,8
EGAmEloop3: push cx
mov cx,1
cmp [mode],0dh ; 320x200 mode ?
jne dont_repeat ;no
inc cx ;print line twice
dont_repeat: push cx
mov bx,offset hp_EGAlineE
call print_msg
mov si,offset line_buffer
mov cx,50 ;50 bytes will be output
EGAmEloop4: push cx ;
xor al,al ;clear acc
mov cx,4 ;
EGAmEloop5: shl al,1 ;bump acc
mov ah,[si] ;get byte
and ah,1 ;get lsb
or al,ah ;move into acc
shl al,1 ;bump acc
or al,ah ;merge
inc si
loop EGAmEloop5 ;
xor al,[reverse]
xor ah,ah ; Output Byte
int 17h ;
pop cx ;
loop EGAmEloop4 ;
pop cx ;do second line?
loop dont_repeat ;if cx=2 then yes
mov si,offset line_buffer
mov cx,200 ;
EGAmEloop6: shr byte ptr [si],1 ;shift byte for next time
inc si
loop EGAmEloop6
pop cx
loop EGAmEloop3
pop cx ;do next column
loop EGAmEloop1 ;
mov bx,offset hp_end
call print_msg
jmp exit
;---------------------------------------
MON_modeF: mov ax,MON_seg
jmp short EGA_hires
EGA_mode10: mov ax,EGA_seg
EGA_hires: mov [vid_seg],ax
mov bx,offset hp_EGAinit
call print_msg
mov cx,80 ;loop through 80 cols
EGAm10loop1: push cx ;
mov si,cx
dec si
mov ax,[vid_seg] ;MON/EGA RAM Buffer
push ds
mov ds,ax
mov di,offset line_buffer ;
mov cx,350 ;read in one column for 350 rows
EGAm10loop2: call get_byteEGA ;(DS:SI) --> (ES:DI)
inc di
add si,80 ; move pointers
loop EGAm10loop2
pop ds
mov cx,8
EGAm10loop3: push cx
mov bx,offset hp_EGAline
call print_msg
mov si,offset line_buffer
mov cx,44 ;44 bytes will be output
EGAm10loop4: push cx ;
xor al,al ;clear acc
mov cx,8 ;build each 44 bit by